package vno.fux.events
{
	import flash.events.Event;
	import vno.fux.BasePoint;
	
	public class NpcEvent extends Event
	{
		public static var CLICK:String = "Npc_Click";
		private var _targetId:uint;
		private var _pos:BasePoint;
		public function NpcEvent(type:String,opts:Object=null)
		{
			super(type);
			if(opts)
			{
				_targetId		= opts["targetId"]?opts["targetId"]:null;
				_pos			= opts["pos"]?opts["pos"]:null;
			}
		}
		
		public function get targetId():uint
		{
			return _targetId;
		}
		public function get pos():BasePoint
		{
			return _pos;
		}
		override public function clone():Event
		{
			return new NpcEvent(type, {targetId:_targetId, pos:_pos});
		}
		
		override public function toString():String
		{
			return formatToString("NpcEvent", "type", "targetId", "bubbles", "cancelable", "eventPhase");
		}
	}
}